package io.aggression.test.persistence;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import com.mongodb.DBCursor;
import com.mongodb.DB;
import com.mongodb.Bytes;
import com.mongodb.DBCollection;
import com.mongodb.MongoClient;
import io.aggression.test.util.RunningConfig;

import java.net.UnknownHostException;

//class to manage db access

public class PersistenceManager {

	private static MongoClient mongoClient = null;

    private static String mongoServer = null;


    public static void init() throws UnknownHostException {

        if ( mongoClient == null ){
            mongoClient = new MongoClient(RunningConfig.getMongoHost());
            //db = mongoClient.getDB(MONGO_DB_NAME);
        }
        else
            return;

    }

    public static MongoClient getMongoClient(){

        return mongoClient;

    }
}
